package com.guigu.www.cxk.controller;

import com.guigu.www.cxk.service.CXKBespeakPojectTypeService;
import com.guigu.www.pojo.BespeakPoject;
import com.guigu.www.pojo.BespeakPojectType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
/*体检项目类型表  体检项目表*/
@Controller
@RequestMapping("/BespeakPojectType")
public class CXKBespeakPojectTypeController {
    @Autowired
    CXKBespeakPojectTypeService bespeakPojectTypeService;

    /*查询体检项目类型表*/
    @PostMapping("/{id}")
    @ResponseBody
    public List<BespeakPojectType> BropeakType(@PathVariable int id){
        return bespeakPojectTypeService.ProType(id);
    }

    /*根据套餐的id查询所需的体检项目*/
    @PostMapping("/ProjectType/{id}")
    @ResponseBody
    public List<BespeakPoject> ProjectType(@PathVariable int id){
        return bespeakPojectTypeService.bespeakProject(id);
    }

    /*根据套餐id查询体检项目的总数*/
    @PostMapping("/ProBeakCount/{number}")
    @ResponseBody
    public int ProBeakCount(@PathVariable int number){
        return bespeakPojectTypeService.bespeakProjectCount(number);
    }
}
